<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>国省自检--${fns:getConfig('productName')}</title>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<style>
.model{background:#fff;}
#x_top{position:fixed;right:30px;bottom:240px;width:35px;height:30px;padding:0;margin:0;border:none;
background:#fff url(${ctx}/images/x_top.png) no-repeat center;cursor:pointer;box-shadow:0 0 3px #aaa;background-size:50%;}
#x_top:hover{background:#eee url(${ctx}/images/x_top.png) no-repeat center;background-size:50%;}
#x_s{cursor:pointer;border:1px solid #41A6F6;height:30px;line-height:30px;display:block;border-radius:3px;padding:0 5px;color:#41A6F6;}
#x_s .x_ico{float:left;margin-right:5px;width:20px;height:30px;background:url(${ctx}/images/x_search.png) no-repeat center;}
#x_s #btnSearch{float:left;font-size:14px;text-decoration:none;color:#1F7BC4;}
#x_s #btnSearch:hover{color:#1F7BC4;}
#x_s:hover{background:#EDF8FE;}

</style>
<script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
<script type="text/javascript">
	function btnClick(){
		var url = '${ctx}/ruralRoadCon/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
		var data = {};
		//有搜索按钮的情况下 获取条件进行搜索
		data['retrieval'] = getJson('condition');
		loadData(url,data);
	}
	//ajax执行成功之后的回调方法
	function loadDataToTable(data){
        var attData = data['att'];
        var manageData = data['manageData'];
        var score = data['score'];
        var scoLists = data['scoLists'];
        var percent = data['percent'];
		//附件的回调方法：
		 loadAttachment(attData);
		//检索文件的回调方法
         for(var j = 0; j<manageData.length;j++ ){
            loadAttachment(manageData[j].attachments);
        }	
		
		//当返回的数据不为空时，说明是根据某个项目或项目区县进行了查询  显示该项目的检查结果
        if(data['flag'] && data['manageData'] != "" ){
        	var tr ="";
        	var content = '<table style="width:98%; height:31px;text-align:center;margin-top:5px;" border="1"><thead><tr style="height:31px">'+
					        	'<th rowspan="2">序号</th>'+
					            '<th rowspan="2">项目名称</th>'+
					            '<th colspan="7">公开内容</th>'+
					            '<th colspan="3">各部门公开情况</th>'+
					            '<th rowspan="2">检查<br>得分</th>'+
					            '<th rowspan="2">检查<br>总分</th>'+
					            '<th rowspan="2">完善度</th></tr>'+
					            '<tr><th>建设计划</th>'+
					            '<th>补助政策</th>'+
					            '<th>招投标</th>'+
					            '<th>施工管理</th>'+
					            '<th>质量监管</th>'+
					            '<th>资金使用</th>'+
					            '<th>工程验收</th>'+
					            '<th>各地级以上<br>市交通运输<br>局（委）</th>'+
					            '<th>县（市、区）<br>交通运输<br>主管部门</th>'+
					            '<th>各乡镇政府</th></tr></thead><tbody>';
            for(var i = 0; i<manageData.length; i++){
                tr += '<tr style="height:30px"><td>'+(i+1)+'</td><td>'+manageData[i].projectName+'</td>';
                if("1" == manageData[i].constructionPlan){
                	 tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].subsidyPolicy){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].tender){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].constructManager){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].qualityControl){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].fundUtilizing){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].acceptanceProject){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].transportBureau){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].competentDepartment){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                if("1" == manageData[i].townGovernment){
                    tr += "<td>"+imgRight+"</td>";
                } else {
                    tr += "<td>"+imgError+"</td>";
                }
                tr += '<td>'+scoLists[i]
                if(i == 0){
                	tr += '</td><td class="sumTd" rowspan="'+manageData.length+'">'+score+'</td><td class="perTd" rowspan="'+manageData.length+'">'+percent+'%</td></tr>';
                }
            }
           		content += tr;
            	content += '</tr></tbody></table>';
            $('#checkResult').append(content);
        }
	}
</script>
</head>
<body>
	<div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/ruralRoadCon/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
	<form id="checkForm" class="form-horizontal"  method="POST"  name="checkForm" action="${ctx}/ruralRoadCon/save.do?left=${fns:encodeParam(left)}&parentId=${fns:encodeParam(parentId)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}">
		<input type="hidden" name="token" value="${token}">
		<div id="show">
			<div id="showTable" class="showTable">
				<jsp:include page="/WEB-INF/views/check/common.jsp"/> 
				<div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="float:left;margin-right:10px;">
							<div>
	                        		<span>选择工程<font style="color:red;">*</font>：</span>
									<tags:treeselect id="office" name="itemProjectId" value="" labelName="objectName" labelValue=""
										title="单位" url="/ruralRoadCon/ruralRoadConData.do?projectId=${projectId}" allowClear="true" checked ="true"/>
                            </div>
								<div style="margin-top:20px">
			                            <span>每个公开内容得分<font style="color:red;">*</font>：</span>
			                            	<input type="text" name="firstStepScore" id="firstStepScore" maxlength="6" class="required conInput" value='1'>
			                            <span>每个公示项目信息得分<font style="color:red;">*</font>：</span>
			                            	<input type="text" name="secondStepScore" id="secondStepScore" maxlength="6" class="required conInput" value='0.5'>
								</div>
							</div>
							<div id="x_s" style="float:right">
								<div class="x_ico"></div>
								<a href="#javascript:void(0)" onclick= "btnClick();"  id= "btnSearch" role="button" >搜索&nbsp;</a>
							</div>
						</div>
				<div class="model">
					<div>
						<legend>四、检索结果</legend>
						<div class="content-title">
							<div class="tabbox">
								<div class="tab">
									<a href="javascript:;" class="on">规章制度</a>
									<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
										<c:if test="${idxStatus.index >= 2}">
											<a href="javascript:;">${menu.name}</a>
										</c:if>
									</c:forEach>
							    </div>
							    <div class="content">
							    	<ul>
							    		<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
							    			<c:if test="${idxStatus.index >= 1}">
								    			<li>
								    				<table style="width:98%;text-align:center;margin-top:5px;" border="1" id="${menu.tag}">
								    					<thead>
									    					<th>序号</th>
									    					<th>操作</th>
									    					<th>发文单位</th>
									    					<th>上传用户</th>
									    					<th>文件名</th>
									    					<th>发文日期</th>
									    					<th>上传日期</th>
									    					<th>文件大小</th>
									    					<th>文件类型</th>
								    					</thead>
								    					<tbody>
								    						
								    					</tbody>
								    				</table>
								    			</li>
								    		</c:if>
							    		</c:forEach>
							        </ul>
							    </div>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>五、检查评分</legend>
						<div class="context-title" id="checkResult">
                           
                        </div>
					</div>
				</div>
				<div class="model">
					<div class="content-btn">
						<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
						&nbsp;&nbsp;&nbsp;&nbsp;
						<input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
					</div>
				</div>
			</div>
		</div>
	</form>
	<script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>